{% extends "multimedia/base.html" %}
{% load i18n %}


{% block subnav %}
<h2>{% trans "Links" %}</h2>
<ul class="action-links">
    <li>
    <a href="{% url multimedia_add "photo" %}">Add Photo</a>
    </li>
    <li>
    <a href="{% url multimedia_add "video" %}">Add Video</a>
    </li>
    <li>
    <a href="{% url multimedia_browse_type "photo" %}">Filter by Photo</a>
    </li>
    <li>
    <a href="{% url multimedia_browse_type "video" %}">Filter by Video</a>
    </li>
</ul>
{% endblock %}

{% block main_content %}
    {% if media_type %}
    <h2>Browse by {{media_type|capfirst}}</h2>
    {% else %}
    <h2>Browse</h2>
    {% endif %}
    {% for item in media_items %}
    <div class="media-list-block" id="media-item-{{item.id}}"
         style="width:240px;float:left;border:1px solid">
        <h2>{{item}} :: {{ item.get_child_name }}</h2>
        <p class="media-thumb">
        <img src="{{item.get_child_object.get_thumbnail_url}}" /></p>
        <p>Dimensions: {{item.get_dimensions}}</p>
        <p>Authors: {{ item.authors.all|join:', ' }}</p>
        <p>Attribution: {{item.attribution|truncatewords:30}}</p>
        <p>Summary: {{item.summary|truncatewords:30}}</p>
        {# TODO actual preview URL; delete URL #}
        <p><a href="{% url multimedia_edit item.id %}">Edit</a>|<a href="{% url multimedia_preview item.id %}">Preview</a>|<a href="">Delete</a></p>

    </div>
    {% empty %}
    <div>You haven't uploaded any {{ media_type }} media yet.</div>
    {% endfor %}
{% endblock %}
